import utils from './utils'
// 正大项目固定参数
const FIXEDVALUE = '402847465c483b5e015c483b8141001c'
export default {
  /**
   * 请求pdf url列表
   * @param {string} FIXEDVALUE 固定参数
   */
  fetchPdfUrlData: () => {
    const url = `/palmmall-server/rest/banlancebill/getattachments/`
    return utils.get(url, FIXEDVALUE)
  },
  /**
   * 登录接口
   * @param {string} principal 用户标识
   * @param {string} password 登录密码
   */
  fetchLoginInterface: (nameCode, pass) => {
    const url = '/palmmall-server/rest/authenticates/tenant-authen'
    const data = {principal: nameCode, password: pass}
    return utils.post(url, data)
  },
  /**
   * 账单查询
   * @param {json} data 请求参数
   */
  fetchBillList: (data) => {
    const url = '/palmmall-server/rest/banlancebill/query'
    return utils.post(url, data)
  },
  /**
   * 是否能够全选
   */
  isSelecteAll: () => {
    const url = `/palmmall-server/rest/authenticates/getOptionByStore/`
    return utils.get(url, FIXEDVALUE)
  },
  /**
   * 账单详情
   * @param {string} uuid 商品列表的uuid
   */
  getDetailsFetch: (uuid) => {
    const url = `/palmmall-server/rest/banlancebill/getDetails/`
    return utils.get(url, uuid)
  },
  /**
   * 表单确认
   * @param {array} accidArray 该详情列表的accid
   */
  getConfirmFetch: (accidArray) => {
    const url = `/palmmall-server/rest/banlancebill/confirm`
    return utils.post(url, accidArray)
  }
}
